Skip to content

test(verify): de-flake SignatureVerifier SV2 and SV7 invariants#3842

Open
grandizzy wants to merge 1 commit intomainfrom
george/de-flake-sv-invariants
Open

test(verify): de-flake SignatureVerifier SV2 and SV7 invariants#3842
grandizzy wants to merge 1 commit intomainfrom
george/de-flake-sv-invariants

Conversation

@grandizzy
Copy link
Copy Markdown
Contributor

@grandizzy grandizzy commented May 6, 2026

Same root cause as #3802: handlers with a single coverage edge get
deprioritized by the corpus-guided fuzzer. With ~50k CI runs the
deprioritization eventually starves a run of any SV2 (or SV7) calls
and trips the coverage assertion.

Changes:

  • Split each SV2 high-s handler (secp/p256/webauthn) into a 'flipped'
    variant (real-sig-derived high s) and a 'boundary' variant
    (s = N - 1 or N/2 + 1) — 6 handlers instead of 3.
  • Split each SV7 keychain handler into a 'validSig' and 'garbageSig'
    variant — 4 handlers instead of 2.
  • Extract _sv2SecpCheck/_sv2P256Check/_sv2WebAuthnCheck/_sv7Check
    helpers so per-handler bodies stay small.

Verified with 10 runs at depth 1000 (fuzz-seed 0xdeadbeef):
SV2 min: 32 -> 58, SV7 min: 20 -> 35.
SV1/SV3/SV6 still have >=28 per-run minimum after the dilution.

Same root cause as #3802: handlers with a single coverage edge get
deprioritized by the corpus-guided fuzzer. With ~50k CI runs the
deprioritization eventually starves a run of any SV2 (or SV7) calls
and trips the coverage assertion.

Changes:
- Split each SV2 high-s handler (secp/p256/webauthn) into a 'flipped'
  variant (real-sig-derived high s) and a 'boundary' variant
  (s = N - 1 or N/2 + 1) — 6 handlers instead of 3.
- Split each SV7 keychain handler into a 'validSig' and 'garbageSig'
  variant — 4 handlers instead of 2.
- Extract _sv2SecpCheck/_sv2P256Check/_sv2WebAuthnCheck/_sv7Check
  helpers so per-handler bodies stay small.

Verified with 10 runs at depth 1000 (fuzz-seed 0xdeadbeef):
  SV2 min: 32 -> 58, SV7 min: 20 -> 35.
SV1/SV3/SV6 still have >=28 per-run minimum after the dilution.
@grandizzy grandizzy self-assigned this May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

📊 Tempo Precompiles Coverage

precompiles

Coverage: 5618/7707 lines (72.89%)

File details
File Lines Coverage
src/account_keychain/dispatch.rs 30/68 44.12%
src/account_keychain/mod.rs 274/736 37.23%
src/address_registry/dispatch.rs 31/33 93.94%
src/address_registry/mod.rs 50/56 89.29%
src/error.rs 39/114 34.21%
src/ip_validation.rs 10/10 100.00%
src/lib.rs 180/216 83.33%
src/nonce/dispatch.rs 9/10 90.00%
src/nonce/mod.rs 46/61 75.41%
src/signature_verifier/dispatch.rs 19/20 95.00%
src/signature_verifier/mod.rs 13/17 76.47%
src/stablecoin_dex/dispatch.rs 92/93 98.92%
src/stablecoin_dex/mod.rs 864/918 94.12%
src/stablecoin_dex/order.rs 110/161 68.32%
src/stablecoin_dex/orderbook.rs 157/216 72.69%
src/storage/evm.rs 192/221 86.88%
src/storage/hashmap.rs 0/158 0.00%
src/storage/mod.rs 27/27 100.00%
src/storage/packing.rs 68/93 73.12%
src/storage/thread_local.rs 165/227 72.69%
src/storage/types/array.rs 0/72 0.00%
src/storage/types/bytes_like.rs 79/162 48.77%
src/storage/types/mapping.rs 27/48 56.25%
src/storage/types/mod.rs 67/91 73.63%
src/storage/types/primitives.rs 21/24 87.50%
src/storage/types/set.rs 28/192 14.58%
src/storage/types/slot.rs 55/81 67.90%
src/storage/types/vec.rs 101/246 41.06%
src/tip20/dispatch.rs 149/165 90.30%
src/tip20/mod.rs 590/693 85.14%
src/tip20/rewards.rs 238/252 94.44%
src/tip20/roles.rs 107/110 97.27%
src/tip20_factory/dispatch.rs 17/18 94.44%
src/tip20_factory/mod.rs 105/125 84.00%
src/tip403_registry/dispatch.rs 55/56 98.21%
src/tip403_registry/mod.rs 334/371 90.03%
src/tip_fee_manager/amm.rs 285/364 78.30%
src/tip_fee_manager/dispatch.rs 81/83 97.59%
src/tip_fee_manager/mod.rs 71/136 52.21%
src/validator_config/dispatch.rs 38/52 73.08%
src/validator_config/mod.rs 171/227 75.33%
src/validator_config_v2/dispatch.rs 71/73 97.26%
src/validator_config_v2/mod.rs 552/611 90.34%

contracts

Coverage: 1/253 lines (0.40%)

File details
File Lines Coverage
src/lib.rs 1/1 100.00%
src/precompiles/account_keychain.rs 0/40 0.00%
src/precompiles/address_registry.rs 0/12 0.00%
src/precompiles/nonce.rs 0/15 0.00%
src/precompiles/signature_verifier.rs 0/3 0.00%
src/precompiles/stablecoin_dex.rs 0/18 0.00%
src/precompiles/tip20.rs 0/61 0.00%
src/precompiles/tip20_factory.rs 0/9 0.00%
src/precompiles/tip403_registry.rs 0/24 0.00%
src/precompiles/tip_fee_manager.rs 0/18 0.00%
src/precompiles/validator_config.rs 0/13 0.00%
src/precompiles/validator_config_v2.rs 0/39 0.00%

Total: 5619/7960 lines (70.59%)

📦 Download full HTML report

@grandizzy grandizzy marked this pull request as ready for review May 7, 2026 04:50
@grandizzy grandizzy requested review from 0xrusowsky and jenpaff May 7, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant